from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired, Length
from flask_ckeditor import CKEditorField


# 使用CKEditor的表单ß
class RichTextForm(FlaskForm):
    title = StringField('标题', validators=[DataRequired(), Length(1, 50)])
    body = CKEditorField('主体', validators=[DataRequired()])
    submit = SubmitField('发布')
    save = SubmitField('保存')  # 第2个提交按钮
